import { S } from '../../s';
import { IPSAppPortletCat } from '../control/ipsapp-portlet-cat';
import { IPSAppDEACMode } from './ipsapp-deacmode';
import { IPSAppDEAction } from './ipsapp-deaction';
import { IPSAppDEDataExport } from './ipsapp-dedata-export';
import { IPSAppDEDataImport } from './ipsapp-dedata-import';
import { IPSAppDEDataSet } from './ipsapp-dedata-set';
import { IPSAppDEField } from './ipsapp-defield';
import { IPSAppDELogic } from './ipsapp-delogic';
import { IPSAppDEMethod } from './ipsapp-demethod';
import { IPSAppDEMethodDTO } from './ipsapp-demethod-dto';
import { IPSAppDEPrint } from './ipsapp-deprint';
import { IPSAppDERS } from './ipsapp-ders';
import { IPSAppDEUIAction } from './ipsapp-deuiaction';
import { IPSAppDEUILogic } from './ipsapp-deuilogic';
import { IPSAppDataEntity } from './ipsapp-data-entity';
import { IPSDER1N } from '../../dataentity/der/ipsder1-n';
import { IPSDEMainState } from '../../dataentity/mainstate/ipsdemain-state';
import { IPSDEOPPriv } from '../../dataentity/priv/ipsdeoppriv';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { IPSSysImage } from '../../res/ipssys-image';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSAppDataEntityImpl
  extends PSModelObjectImpl
  implements IPSAppDataEntity
{
  protected allpsappdeacmodes: IPSAppDEACMode[];
  getAllPSAppDEACModes(): IPSAppDEACMode[] | null {
    return (
      this.allpsappdeacmodes ||
      (this.allpsappdeacmodes = this.fillChildListModel(
        this.M.getAllPSAppDEACModes,
        S._1f6,
      ) as IPSAppDEACMode[])
    );
  }

  findPSAppDEACMode(objKey: any): IPSAppDEACMode | null {
    return this.getPSModel5(
      S._1f6,
      this.getAllPSAppDEACModes(),
      objKey,
    ) as IPSAppDEACMode;
  }

  protected allpsappdeactions: IPSAppDEAction[];
  getAllPSAppDEActions(): IPSAppDEAction[] | null {
    return (
      this.allpsappdeactions ||
      (this.allpsappdeactions = this.fillChildListModel(
        this.M.getAllPSAppDEActions,
        S._2,
      ) as IPSAppDEAction[])
    );
  }

  findPSAppDEAction(objKey: any): IPSAppDEAction | null {
    return this.getPSModel5(
      S._2,
      this.getAllPSAppDEActions(),
      objKey,
    ) as IPSAppDEAction;
  }

  protected allpsappdedataexports: IPSAppDEDataExport[];
  getAllPSAppDEDataExports(): IPSAppDEDataExport[] | null {
    return (
      this.allpsappdedataexports ||
      (this.allpsappdedataexports = this.fillChildListModel(
        this.M.getAllPSAppDEDataExports,
        S._1fb,
      ) as IPSAppDEDataExport[])
    );
  }

  findPSAppDEDataExport(objKey: any): IPSAppDEDataExport | null {
    return this.getPSModel5(
      S._1fb,
      this.getAllPSAppDEDataExports(),
      objKey,
    ) as IPSAppDEDataExport;
  }

  protected allpsappdedataimports: IPSAppDEDataImport[];
  getAllPSAppDEDataImports(): IPSAppDEDataImport[] | null {
    return (
      this.allpsappdedataimports ||
      (this.allpsappdedataimports = this.fillChildListModel(
        this.M.getAllPSAppDEDataImports,
        S._1fd,
      ) as IPSAppDEDataImport[])
    );
  }

  findPSAppDEDataImport(objKey: any): IPSAppDEDataImport | null {
    return this.getPSModel5(
      S._1fd,
      this.getAllPSAppDEDataImports(),
      objKey,
    ) as IPSAppDEDataImport;
  }

  protected allpsappdedatasets: IPSAppDEDataSet[];
  getAllPSAppDEDataSets(): IPSAppDEDataSet[] | null {
    return (
      this.allpsappdedatasets ||
      (this.allpsappdedatasets = this.fillChildListModel(
        this.M.getAllPSAppDEDataSets,
        S._3,
      ) as IPSAppDEDataSet[])
    );
  }

  findPSAppDEDataSet(objKey: any): IPSAppDEDataSet | null {
    return this.getPSModel5(
      S._3,
      this.getAllPSAppDEDataSets(),
      objKey,
    ) as IPSAppDEDataSet;
  }

  protected allpsappdefields: IPSAppDEField[];
  getAllPSAppDEFields(): IPSAppDEField[] | null {
    return (
      this.allpsappdefields ||
      (this.allpsappdefields = this.fillChildListModel(
        this.M.getAllPSAppDEFields,
        S._1,
      ) as IPSAppDEField[])
    );
  }

  findPSAppDEField(objKey: any): IPSAppDEField | null {
    return this.getPSModel5(
      S._1,
      this.getAllPSAppDEFields(),
      objKey,
    ) as IPSAppDEField;
  }

  protected allpsappdelogics: IPSAppDELogic[];
  getAllPSAppDELogics(): IPSAppDELogic[] | null {
    return (
      this.allpsappdelogics ||
      (this.allpsappdelogics = this.fillChildListModel(
        this.M.getAllPSAppDELogics,
        S._1ff,
      ) as IPSAppDELogic[])
    );
  }

  findPSAppDELogic(objKey: any): IPSAppDELogic | null {
    return this.getPSModel5(
      S._1ff,
      this.getAllPSAppDELogics(),
      objKey,
    ) as IPSAppDELogic;
  }

  protected allpsappdemethoddtos: IPSAppDEMethodDTO[];
  getAllPSAppDEMethodDTOs(): IPSAppDEMethodDTO[] | null {
    return (
      this.allpsappdemethoddtos ||
      (this.allpsappdemethoddtos = this.fillChildListModel(
        this.M.getAllPSAppDEMethodDTOs,
        S._3cc,
      ) as IPSAppDEMethodDTO[])
    );
  }

  findPSAppDEMethodDTO(objKey: any): IPSAppDEMethodDTO | null {
    return this.getPSModel5(
      S._3cc,
      this.getAllPSAppDEMethodDTOs(),
      objKey,
    ) as IPSAppDEMethodDTO;
  }

  protected allpsappdemethods: IPSAppDEMethod[];
  getAllPSAppDEMethods(): IPSAppDEMethod[] | null {
    return (
      this.allpsappdemethods ||
      (this.allpsappdemethods = this.fillChildListModel(
        this.M.getAllPSAppDEMethods,
        S._4,
      ) as IPSAppDEMethod[])
    );
  }

  findPSAppDEMethod(objKey: any): IPSAppDEMethod | null {
    return this.getPSModel5(
      S._4,
      this.getAllPSAppDEMethods(),
      objKey,
    ) as IPSAppDEMethod;
  }

  protected allpsappdeprints: IPSAppDEPrint[];
  getAllPSAppDEPrints(): IPSAppDEPrint[] | null {
    return (
      this.allpsappdeprints ||
      (this.allpsappdeprints = this.fillChildListModel(
        this.M.getAllPSAppDEPrints,
        S._3ab,
      ) as IPSAppDEPrint[])
    );
  }

  findPSAppDEPrint(objKey: any): IPSAppDEPrint | null {
    return this.getPSModel5(
      S._3ab,
      this.getAllPSAppDEPrints(),
      objKey,
    ) as IPSAppDEPrint;
  }

  protected allpsappdeuiactions: IPSAppDEUIAction[];
  getAllPSAppDEUIActions(): IPSAppDEUIAction[] | null {
    return (
      this.allpsappdeuiactions ||
      (this.allpsappdeuiactions = this.fillChildListModel(
        this.M.getAllPSAppDEUIActions,
        S._286,
      ) as IPSAppDEUIAction[])
    );
  }

  findPSAppDEUIAction(objKey: any): IPSAppDEUIAction | null {
    return this.getPSModel5(
      S._286,
      this.getAllPSAppDEUIActions(),
      objKey,
    ) as IPSAppDEUIAction;
  }

  protected allpsappdeuilogics: IPSAppDEUILogic[];
  getAllPSAppDEUILogics(): IPSAppDEUILogic[] | null {
    return (
      this.allpsappdeuilogics ||
      (this.allpsappdeuilogics = this.fillChildListModel(
        this.M.getAllPSAppDEUILogics,
        S._205,
      ) as IPSAppDEUILogic[])
    );
  }

  findPSAppDEUILogic(objKey: any): IPSAppDEUILogic | null {
    return this.getPSModel5(
      S._205,
      this.getAllPSAppDEUILogics(),
      objKey,
    ) as IPSAppDEUILogic;
  }

  protected allpsappportletcats: IPSAppPortletCat[];
  getAllPSAppPortletCats(): IPSAppPortletCat[] | null {
    return (
      this.allpsappportletcats ||
      (this.allpsappportletcats = this.fillChildListModel(
        this.M.getAllPSAppPortletCats,
        S._c,
      ) as IPSAppPortletCat[])
    );
  }

  findPSAppPortletCat(objKey: any): IPSAppPortletCat | null {
    return this.getPSModel5(
      S._c,
      this.getAllPSAppPortletCats(),
      objKey,
    ) as IPSAppPortletCat;
  }

  protected allpsdemainstates: IPSDEMainState[];
  getAllPSDEMainStates(): IPSDEMainState[] | null {
    return (
      this.allpsdemainstates ||
      (this.allpsdemainstates = this.fillChildListModel(
        this.M.getAllPSDEMainStates,
        S._208,
      ) as IPSDEMainState[])
    );
  }

  findPSDEMainState(objKey: any): IPSDEMainState | null {
    return this.getPSModel5(
      S._208,
      this.getAllPSDEMainStates(),
      objKey,
    ) as IPSDEMainState;
  }

  protected allpsdeopprivs: IPSDEOPPriv[];
  getAllPSDEOPPrivs(): IPSDEOPPriv[] | null {
    return (
      this.allpsdeopprivs ||
      (this.allpsdeopprivs = this.fillChildListModel(
        this.M.getAllPSDEOPPrivs,
        S._270,
      ) as IPSDEOPPriv[])
    );
  }

  findPSDEOPPriv(objKey: any): IPSDEOPPriv | null {
    return this.getPSModel5(
      S._270,
      this.getAllPSDEOPPrivs(),
      objKey,
    ) as IPSDEOPPriv;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get codeName2(): string {
    return this.M.codeName2;
  }

  get dEAPICodeName(): string {
    return this.M.dEAPICodeName;
  }

  get dEAPICodeName2(): string {
    return this.M.dEAPICodeName2;
  }

  get dEAPITag(): string {
    return this.M.dEAPITag;
  }

  get dEFGroupMode(): 'REPLACE' | 'OVERWRITE' | 'EXCLUDE' {
    return this.M.dEFGroupMode;
  }

  get dataAccCtrlArch(): 1 | 2 {
    return this.M.dataAccCtrlArch;
  }

  get dataAccCtrlMode(): 0 | 1 | 2 | 3 {
    return this.M.dataAccCtrlMode;
  }

  protected datatypepsappdefield: IPSAppDEField;
  getDataTypePSAppDEField(): IPSAppDEField | null {
    if (this.datatypepsappdefield != null) return this.datatypepsappdefield;
    const value = this.M.getDataTypePSAppDEField;
    if (value == null) {
      return;
    }
    this.datatypepsappdefield = this.findPSAppDEField(value);
    return this.datatypepsappdefield;
  }

  protected defaultpsappdedataexport: IPSAppDEDataExport;
  getDefaultPSAppDEDataExport(): IPSAppDEDataExport | null {
    if (this.defaultpsappdedataexport != null)
      return this.defaultpsappdedataexport;
    const value = this.M.getDefaultPSAppDEDataExport;
    if (value == null) {
      return;
    }
    this.defaultpsappdedataexport = this.findPSAppDEDataExport(value);
    return this.defaultpsappdedataexport;
  }

  protected defaultpsappdedataimport: IPSAppDEDataImport;
  getDefaultPSAppDEDataImport(): IPSAppDEDataImport | null {
    if (this.defaultpsappdedataimport != null)
      return this.defaultpsappdedataimport;
    const value = this.M.getDefaultPSAppDEDataImport;
    if (value == null) {
      return;
    }
    this.defaultpsappdedataimport = this.findPSAppDEDataImport(value);
    return this.defaultpsappdedataimport;
  }

  protected defaultpsappdeprint: IPSAppDEPrint;
  getDefaultPSAppDEPrint(): IPSAppDEPrint | null {
    if (this.defaultpsappdeprint != null) return this.defaultpsappdeprint;
    const value = this.M.getDefaultPSAppDEPrint;
    if (value == null) {
      return;
    }
    this.defaultpsappdeprint = this.findPSAppDEPrint(value);
    return this.defaultpsappdeprint;
  }

  get dynaInstTag(): string {
    return this.M.dynaInstTag;
  }

  get enableUIActions(): 1 | 2 | 4 {
    return this.M.enableUIActions;
  }

  protected formtypepsappdefield: IPSAppDEField;
  getFormTypePSAppDEField(): IPSAppDEField | null {
    if (this.formtypepsappdefield != null) return this.formtypepsappdefield;
    const value = this.M.getFormTypePSAppDEField;
    if (value == null) {
      return;
    }
    this.formtypepsappdefield = this.findPSAppDEField(value);
    return this.formtypepsappdefield;
  }

  protected indextypepsappdefield: IPSAppDEField;
  getIndexTypePSAppDEField(): IPSAppDEField | null {
    if (this.indextypepsappdefield != null) return this.indextypepsappdefield;
    const value = this.M.getIndexTypePSAppDEField;
    if (value == null) {
      return;
    }
    this.indextypepsappdefield = this.findPSAppDEField(value);
    return this.indextypepsappdefield;
  }

  protected keypsappdefield: IPSAppDEField;
  getKeyPSAppDEField(): IPSAppDEField | null {
    if (this.keypsappdefield != null) return this.keypsappdefield;
    const value = this.M.getKeyPSAppDEField;
    if (value == null) {
      return;
    }
    this.keypsappdefield = this.findPSAppDEField(value);
    return this.keypsappdefield;
  }

  protected lnpslanguageres: IPSLanguageRes;
  getLNPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.lnpslanguageres ||
      (this.lnpslanguageres = this.fillObjectModel(
        S._276,
        this.M.getLNPSLanguageRes,
        S._2a0,
      ) as IPSLanguageRes)
    );
  }

  get logicName(): string {
    return this.M.logicName;
  }

  protected mainstatepsappdefields: IPSAppDEField[];
  getMainStatePSAppDEFields(): IPSAppDEField[] | null {
    return (
      this.mainstatepsappdefields ||
      (this.mainstatepsappdefields = this.fillChildListModel(
        this.M.getMainStatePSAppDEFields,
        S._1,
      ) as IPSAppDEField[])
    );
  }

  protected majorpsappdefield: IPSAppDEField;
  getMajorPSAppDEField(): IPSAppDEField | null {
    if (this.majorpsappdefield != null) return this.majorpsappdefield;
    const value = this.M.getMajorPSAppDEField;
    if (value == null) {
      return;
    }
    this.majorpsappdefield = this.findPSAppDEField(value);
    return this.majorpsappdefield;
  }

  protected minorpsappderss: IPSAppDERS[];
  getMinorPSAppDERSs(): IPSAppDERS[] | null {
    return (
      this.minorpsappderss ||
      (this.minorpsappderss = this.fillChildListModel(
        this.M.getMinorPSAppDERSs,
        S._e,
      ) as IPSAppDERS[])
    );
  }

  protected orgidpsappdefield: IPSAppDEField;
  getOrgIdPSAppDEField(): IPSAppDEField | null {
    if (this.orgidpsappdefield != null) return this.orgidpsappdefield;
    const value = this.M.getOrgIdPSAppDEField;
    if (value == null) {
      return;
    }
    this.orgidpsappdefield = this.findPSAppDEField(value);
    return this.orgidpsappdefield;
  }

  getPSDEName(): string {
    return this.M.getPSDEName;
  }

  protected psder1n: IPSDER1N;
  getPSDER1N(): IPSDER1N | null {
    return (
      this.psder1n ||
      (this.psder1n = this.fillObjectModel(
        S._273,
        this.M.getPSDER1N,
        S._2c3,
      ) as IPSDER1N)
    );
  }

  protected pssysimage: IPSSysImage;
  getPSSysImage(): IPSSysImage | null {
    return (
      this.pssysimage ||
      (this.pssysimage = this.fillObjectModel(
        S._27b,
        this.M.getPSSysImage,
        S._2ad,
      ) as IPSSysImage)
    );
  }

  protected quicksearchpsappdefields: IPSAppDEField[];
  getQuickSearchPSAppDEFields(): IPSAppDEField[] | null {
    return (
      this.quicksearchpsappdefields ||
      (this.quicksearchpsappdefields = this.fillChildListModel(
        this.M.getQuickSearchPSAppDEFields,
        S._1,
      ) as IPSAppDEField[])
    );
  }
  protected requestpaths: string[];
  getRequestPaths(): string[] | null {
    if (this.requestpaths == null) {
      const value = this.M.requestPaths;
      if (value == null) {
        return null;
      }
      const arrayNode: any[] = value;
      if (arrayNode.length == 0) {
        return null;
      }
      const list: string[] = [];
      for (let i = 0; i < arrayNode.length; i++) {
        list.push(arrayNode[i]);
      }
      this.requestpaths = list;
    }
    return this.requestpaths;
  }

  get storageMode(): 0 | 1 | 3 | 4 {
    return this.M.storageMode;
  }

  get sysAPITag(): string {
    return this.M.sysAPITag;
  }

  get defaultMode(): boolean {
    return this.M.defaultMode;
  }

  get enableDEMainState(): boolean {
    return this.M.enableDEMainState != null ? this.M.enableDEMainState : false;
  }

  get enableFilterActions(): boolean {
    return this.M.enableFilterActions;
  }

  get enableTempData(): boolean {
    return this.M.enableTempData != null ? this.M.enableTempData : false;
  }

  get enableUICreate(): boolean {
    return this.M.enableUICreate;
  }

  get enableUIModify(): boolean {
    return this.M.enableUIModify;
  }

  get enableUIRemove(): boolean {
    return this.M.enableUIRemove;
  }

  get enableWFActions(): boolean {
    return this.M.enableWFActions;
  }

  get major(): boolean {
    return this.M.major;
  }
  get cls(): string {
    return 'PSAppDataEntityImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._f) return true;
    return super.instanceof(cls);
  }
}
